<?php
/**
 * Smithy PHP library
 *
 * LICENSE
 *
 * This source file is subject to the new BSD license that is bundled
 * with this package in the file LICENSE.txt.
 * Smithy is a free Zend Framework based PHP library.
 *
 * @category   Smithy
 * @package    Smithy_View
 * @subpackage Helper
 * @copyright  Copyright (c) 2008-2009 Kovács Tamás
 * @license    New BSD License
 * @version    $Id: Abstract.php ktamas $
 */

/**
 * @see Zend_View_Interface
 */
require_once 'Zend/View/Interface.php';

/**
 * Form helper
 *
 * @category   Smithy
 * @package    Smithy_View
 * @subpackage Helper
 */
class Smithy_View_Helper_StandardForm
{
    /**
     * @var Zend_View_Interface
     */
    public $view;


    /**
     * Renders the form with error messages grouped at the top of the form.
     *
     * @param Zend_Form $form The form to be rendered
     * @return string
     */
    public function standardForm(Zend_Form $form)
    {
        $this->view->form = $form;
        return $this->view->render('_standardForm.phtml');
    }

    /**
     * Sets the view field
     * @param $view Zend_View_Interface
     */
    public function setView(Zend_View_Interface $view)
    {
        $this->view = $view;
    }
}
